package day5;

public class Driver {
    String name;
    public Driver(String name){
        this.name=name;
    }
    public void drive(Car a){
        System.out.println("司机"+name+"驾驶排量为"+a.disp+"座位为"+a.seat+"座的汽车");
        a.drivecar();
    }
    public void drive(Plane b){
        System.out.println("司机"+name+"驾驶飞行高度为"+b.height+"米，座位为"+b.seat+"座的飞机");
        b.driveplane();
    }
    public void drive(Tank c){
        System.out.println("司机"+name+"驾驶马力为"+c.disp+"马力，携弹数为"+c.ammo+"枚的坦克");
        c.drivetank();
    }
    public void drive(Tractor d){
        System.out.println("司机"+name+"驾驶载重为"+d.load +"吨，体积为"+d.volume+"方的拖拉机");
        d.drivetractor();
    }
    public void drive(Steamship e){
        System.out.println("司机"+name+"驾驶载重为"+e.load +"吨，排水量"+e.disp+"立方米/小时，航速为"+e.speed+"海里/小时的轮船");
        e.drivetractor();
    }
}
